package com.oil.petro.eshop.bean;

import com.oil.petro.eshop.entity.Product;
import com.oil.petro.eshop.utils.ProductHelper;

public class CartBean extends BasicBean{
    
    private int number;
    private String productName;
    private String price;
    private int orderedQuantity;
    private float priceForAll;
    private String displayedPriceForAll;
    private int orderId;

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public int getOrderedQuantity() {
        return orderedQuantity;
    }

    public void setOrderedQuantity(int orderedQuantity) {
        this.orderedQuantity = orderedQuantity;
    }

    public float getPriceForAll() {
        return priceForAll;
    }

    public void setPriceForAll(float priceForAll) {
        this.priceForAll = priceForAll;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public String getDisplayedPriceForAll() {
        return displayedPriceForAll;
    }

    public void setDisplayedPriceForAll(String displayedPriceForAll) {
        this.displayedPriceForAll = displayedPriceForAll;
    }

    
    public CartBean(int number,int quantity, Product product,int orderId) {
        this.number = number;
        this.productName = product.getName();
        this.price = ProductHelper.getDisplayedPrice(product.getCost());
        this.orderedQuantity = quantity;
        this.priceForAll = orderedQuantity*product.getCost();
        this.displayedPriceForAll = ProductHelper.getDisplayedPrice(priceForAll);
        this.orderId = orderId;
    }
    
    
}
